package com.coocaa.ops.admin.v1.auth.sys;

import com.coocaa.ops.admin.base.annotation.Auth;
import com.coocaa.ops.admin.base.annotation.Config;
import com.coocaa.ops.admin.base.controller.MgrBaseController;
import com.coocaa.ops.admin.v1.auth.sys.model.query.SysRunModel;
import com.coocaa.ops.admin.v1.auth.sys.service.impl.SysRunServiceImpl;
import com.coocaa.ops.common.core.base.enums.AuthEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author bijiahao
 * @date : 2019/3/25.
 * @description
 */
@RestController
@RequestMapping("/v1/sysRun")
public class SysRunController extends MgrBaseController {
    @Autowired
    private SysRunServiceImpl sysRunService;

    /**
     * 获取所有权限按钮
     *
     * @return
     * @throws Exception
     */
    @Auth(verifyAuthority = true, authorityType = AuthEnum.BROWSER)
    @RequestMapping(value = "/listAllRun",method = {RequestMethod.GET,RequestMethod.POST}, produces = "text/html;charset=UTF-8")
    public String listAllRun(HttpServletRequest request, SysRunModel model) throws Exception {
        Map result = sysRunService.listAllRun();
        return render2Json(result);
    }
}
